<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="button" value="aaa" id="abc">
<span></span>
</body>
<script>
  let a = document.querySelector("#abc")
  let b = document.querySelector("span")
  b.innerText = a.id
</script>
</html>